local skel = fk.CreateSkill {
  name = "emo__bianji",
}

Fk:loadTranslationTable{
  ["emo__bianji"] = "鞭击",
  [":emo__bianji"] = "你受到伤害后，可以对一名其他角色造成1点伤害。",

  ["#emo__bianji-choose"] = "鞭击:你可以对1名其他角色造成1点伤害",
}

skel:addEffect(fk.Damaged, {
  anim_type = "masochism",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and target == player
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    local tos = room:askToChoosePlayers(player, {
      min_num = 1, max_num = 1, targets = room:getOtherPlayers(player, false), skill_name = skel.name,
      prompt = "#emo__bianji-choose",
    })
    if #tos > 0 then
      event:setCostData(self, {tos = tos})
      return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local to = event:getCostData(self).tos[1]
    room:damage { from = player, to = to, damage = 1, skillName = skel.name }
  end,
})

return skel
